import java.util.*;
public class Lab09Task05 {
public static void main(String[] args){
Scanner kb= new Scanner(System.in);
int n;
do{	
System.out.print("Enter the array size: ");
n=kb.nextInt();
if(n<1)
System.out.println("Error: Ivalid size.");
}while(n<1);
double[] arr=new double[n];
boolean non_decreasing=true;
System.out.print("Enter element#1 of the array: ");
arr[0]=kb.nextDouble();
for(int i=1;i<n;i++) {
System.out.printf("Enter element#%d of the array: ",i+1);
arr[i]=kb.nextDouble();
if(arr[i-1]>arr[i])
non_decreasing=false;
}
if(non_decreasing)
System.out.print("The array is stored in non-decreasing order");
else
System.out.print("The array is not stored in non-decreasing order");
kb.close();
}
}
